﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace StreetlightGames.SpaceShooter
{
    public class ExplosionParticle
    {
        /// <summary>Gets or sets the Vertex value</summary>
        public VertexPositionColor Vertex
        {
            get { return _vertex; }
            set { _vertex = value; }
        }
        private VertexPositionColor _vertex;

        /// <summary>Gets or sets the Velocity value</summary>
        public Vector3 Velocity
        {
            get { return _velocity; }
            set { _velocity = value; }
        }
        private Vector3 _velocity;

        /// <summary>Gets or sets the BurnTime value</summary>
        public double BurnTime
        {
            get { return _burnTime; }
            set { _burnTime = value; }
        }
        private double _burnTime;

        public ExplosionParticle(VertexPositionColor vertex, Vector3 velocity, double burntime)
        {
            Vertex = vertex;
            Velocity = velocity;
            BurnTime = burntime;
        }

        public void Update(GameTime gameTime)
        {
            float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
            _vertex.Position.X += Velocity.X * elapsedTime;
            _vertex.Position.Y += Velocity.Y * elapsedTime;
            _vertex.Position.Z += Velocity.Z * elapsedTime;
        }
    }
}
